def fine(string):
    if string == 'W' or string == 'S' or string == 'A' or string == 'D':
        return True
    else:
        return False

def analyse(string,x,y):
    if string == 'W':
        return x - 1, y
    if string == 'S':
        return x + 1, y
    if string == 'A':
        return x, y - 1
    if string == 'D':
        return x,y + 1

def do_analyse(string,x,y):
    x,y = analyse(string,x,y)
    return x,y

def illegal(v):
    if v < 0 or v >= 5:
        return True
    return False

def make_legal(v):
    if v < 0:
        return 5 - abs(v)
    if v >= 5:
        return v % 5
    
def output(x,y):
    for i in range(0,5):
        for j in range(0,5):
            if i != x or j != y:
                print("*",end = '')
            else:
                print("#",end = '')
        print()

def do():
    string = str(input())
    x,y = 0,0
    while fine(string) == True:
        x,y = do_analyse(string,0,0)
        if illegal(x) == True:
            x = make_legal(x)
        if illegal(y) == True:
            y = make_legal(y)
        string = str(input())
    output(x,y)
    
do()